import { PORT1 } from "@/api/config/servicePort";
import Http from "@/api/index";

const baseUrl = PORT1 + "/system/friendly";

export const createApi = (params: any) => {
  return Http.post(baseUrl + "/add", params);
};

export const editApi = (params: any) => {
  return Http.put(baseUrl + "/edit", params);
};

export const deleteApi = (params: any) => {
  return Http.post(baseUrl + "/delete", params);
};

export const list = () => {
  return Http.get(baseUrl + "/list");
};

// 获取城市列表
export const getCityList = () => {
  return Http.get(baseUrl + "/get_city");
};

// 获取城市链接
export const getCityLink = (params: any) => {
  return Http.get(baseUrl + "/city_list", params);
};

// 创建城市友情链接
export const createFriendlyLink = (params: any) => {
  return Http.post(baseUrl + "/add_link", params);
};

// 编辑友情链接
export const editFriendlyLink = (params: any) => {
  return Http.put(baseUrl + "/edit_link", params);
};

// 删除友情链接
export const deleteFriendlyLink = (params: any) => {
  return Http.post(baseUrl + "/delete_link", params);
};
